package com.atguigu.campusintelligentassistantsystem.config;

import com.alibaba.dashscope.aigc.generation.Generation;
import com.alibaba.dashscope.utils.Constants;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class AiConfig {

    @Value("${aliyun.bailian.api-key:your-api-key}")
    private String apiKey;

    @Bean
    public Generation generation() {
        // 设置API密钥
        Constants.apiKey = apiKey;
        return new Generation();
    }
}